import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/home/pointManagement',
        name: 'pointManagement',
        component: () => import(/* webpackChunkName: "about" */ '../views/PointManagement.vue')
      },{
        path: '/home/layerManagement',
        name: 'layerManagement',
        component: () => import(/* webpackChunkName: "about" */ '../views/LayerManagement.vue')
      },{
        path: '/home/editPoint',
        name: 'editPoint',
        component: () => import(/* webpackChunkName: "about" */ '../views/EditPoint.vue')
      },{
        path: '/home/areaList',
        name: 'areaList',
        component: () => import(/* webpackChunkName: "about" */ '../views/AreaList.vue')
      },{
        path: '/home/editArea',
        name: 'editArea',
        component: () => import(/* webpackChunkName: "about" */ '../views/EditArea.vue')
      },{
        path: '/home/test',
        name: 'test',
        component: () => import(/* webpackChunkName: "about" */ '../views/Test.vue')
      },
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
